// http://ip/imageurl
import { request } from '../../request/index.js'

Page({
  data: {
    list: [{}, {}, {}]
  },
  onLoad() {
    this.getPostList()
  },
  async getPostList() {
    const result = await request({
      url: '/secondhand/goods/getCollections',
    })
    console.log(result.data.obj)
    for (let i = 0; i < result.data.obj.length; i++) {
      result.data.obj[i].imageURL = 'http://47.102.99.215/' + result.data.obj[i].imageURL
    }
    this.setData({
      list: result.data.obj
    })
  },
  //跳转详情
  detail: function (e) {
    let that = this;
    wx.navigateTo({
      url: '/pages/detail/detail?scene=' + e.currentTarget.dataset.id,
    })
  },
})